pub mod data;
use crate::data::*;

#[allow(unused)]
fn part1() {
    let contents = std::fs::read_to_string("./day06/input.txt").unwrap();
    let mut lines = contents.lines();
    let time_str = lines.next().unwrap();
    let distance_str = lines.next().unwrap();
    let datas = get_part1_datas(time_str, distance_str);
    
    let multiple: u64 = datas
        .iter()
        .fold(1 as u64, |acc, data| {
            acc * data.beat_record_size()
        });
    println!("{multiple}");
}

#[allow(unused)]
fn part2() {
    let contents = std::fs::read_to_string("./day06/input.txt").unwrap();
    let mut lines = contents.lines();
    let time_str = lines.next().unwrap();
    let distance_str = lines.next().unwrap();

    let data = get_part2_data(time_str, distance_str);
    println!("{}", data.beat_record_size());
}

fn main() {
    part2();
}
